package za.org.jcicada.genss;

import java.net.URI;
import java.net.URISyntaxException;

import za.org.jcicada.genss.alarm.IAlarmSubject;
import za.org.jcicada.genss.lifecycle.ILifeCycleServer;
import za.org.jcicada.genss.sensor.ISensorSubject;

/**
 * IGenSS.java
 *
 * @author Simon Cross
 *
 * Created on November 11, 2008, 14:10
 */


/**
 * Interace describing a Generic Software Subsystem
 */
public interface IGenSS {
    
    /**
     * Initialize the generic software subsystem before use.
     */
    void initialize();
    
    /**
     * Wait for the GenSS to receive a halt or restart request.
     * @return true for restart else false to halt
     */
    boolean waitHalt();
    
    /**
     * Shut down the generic software subsystem after use.
     */
    void shutdown();
    
    /**
     * Get GenSS lifecycle control interface.
     */
    ILifeCycleServer getLifeCycleServer();

    /**
     * Get GenSS alarm interface.
     */
    IAlarmSubject getAlarmSubject();

    /**
     * Get GenSS sensor interface.
     */
    ISensorSubject getSensorSubject();
    
    SystemURN getSystemURN();
    
    /**
     * Get the service location URI for the acceptor with the specified protocol
     * for the named service
     * @param protocol desired acceptor protocol
     * @param serviceURN name of service to find
     * @return the service location URI or null if no match found
     * @throws URISyntaxException
     */
    URI getServiceLocationURI(String protocol, ServiceURN serviceURN) throws URISyntaxException;
    
}
